fix(s2s): dispatch on the transcription model names the config uses - #873
Merged
Conversation
SpeechRecognitionAgent.from_config matched on "LocalWhisper (Free)", "FasterWhisper (Free)" and "OpenAI (Cloud)", but TRANSCRIBE_MODELS, the shipped config.toml and the Streamlit configurator all use the bare names. Every valid config fell through to the default arm and raised, so from_config could not load any of the three models. Also gives the VAD match a default arm. It had none, so an unrecognised vad_model left vad unbound and surfaced as an UnboundLocalError.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #873 +/- ##
=======================================
Coverage 74.41% 74.41%
=======================================
Files 82 82
Lines 3627 3627
=======================================
Hits 2699 2699
Misses 928 928 ☔ View full report in Codecov by Harness. |
boczekbartek
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
SpeechRecognitionAgent.from_configcannot load any valid config. It raises for every accepted value oftranscription_model.Proposed Changes
asr_agent.pyexpected"LocalWhisper (Free)","FasterWhisper (Free)"and"OpenAI (Cloud)", whileTRANSCRIBE_MODELS, the shippedconfig.tomland the configurator all use the bare names. Anything valid fell through tocase _and raised. Now matches the bare names, with the error message namingmodel_typeand the valid options instead ofmodel_name(and without the strayfinside the string).vad_modelleftvadunbound and came out as anUnboundLocalErrorat construction.rai_s2s1.0.2.Issues
Testing
tests/s2s/test_asr_agent_from_config.pywalksTRANSCRIBE_MODELSand asserts every advertised value reaches a model, with the models and the agent constructor stubbed so nothing is downloaded or opens a device. Also covers the old suffixed spelling and an unknownvad_model.pytest tests/s2s tests/communication/sounds_device: 37 passed.